﻿using AutoTest.Business.Dto.Goods;
using AutoTest.Business.Dto.Product;
using AutoTest.Business.IServices;
using AutoTest.Business.Vo.Goods;
using AutoTest.Business.Vo.Product;
using AutoTest.Framework.Api;
using Microsoft.AspNetCore.Mvc;

namespace AutoTest.WebApi.Controllers.Admin
{
    /// <summary>
    /// 链接管理
    /// </summary>
    [Route("admin/product/manage")]
    public class ProductManageController(IProductService productService) : Controller
    {
        private readonly IProductService _productService = productService;

        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="searchDto"></param>
        /// <returns></returns>
        [HttpGet("list")]
        public async Task<ApiResult<List<ProductListVo>>> SearchProductListAsync([FromQuery] ProductListSearchDto searchDto)
        {
            return await ApiResult<List<ProductListVo>>.Successed(() => _productService.SearchProductListAsync(searchDto));
        }

    }
}
